package com.xintai.approval.Utils;

import com.xintai.approval.domain.NodeConfig;

import java.util.Comparator;

/**
 * 流程排序
 */
public class FlowIdSortUtils implements Comparator<NodeConfig> {

    @Override
    public int compare(NodeConfig o1, NodeConfig o2) {
        //按名字升序排序
        Long flowId1 = o1.getFlowId();
        Long flowId2 = o2.getFlowId();
        //倒序比较
//        int n = name2.compareTo(name1);  //name1>name2返回正整数，反之返回负整数，相等返回0
        //升序比较
        int n = flowId1.compareTo(flowId2);
        return n;
    }
}
